package org.jeecgframework.web.controller;

import javax.servlet.http.HttpServletRequest;

import org.apache.log4j.Logger;
import org.jeecgframework.core.util.DataUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
/**   
 * @Title: Controller
 * @Description: 系统首页
 * @author dongzq
 * @date 2016-03-23 17:20:07
 * @version V1.0   
 *
 */
@Controller
@RequestMapping("/homePageController")
public class HomeController {
	/**
	 * Logger for this class
	 */
	@SuppressWarnings("unused")
	private static final Logger logger = Logger.getLogger(ZyCinemaController.class); // NOPMD by dzqThinkpad on 16-4-1 下午3:00
	
	
	/**
	 * 处理系统首页日历组件
	 * @author dongzq
	 * @date 2016-03-23
	 * @param request
	 * @return
	 */
	@RequestMapping(params = "calendar")
	public ModelAndView zyCinema(HttpServletRequest request) {
		request.setAttribute("today", DataUtils.getDate());
		return new ModelAndView("main/calendarView");
	}
	
	@RequestMapping(params = "statistics")
	public ModelAndView userBroswer(String reportType, HttpServletRequest request) {
		request.setAttribute("reportType", reportType);
		if("pie".equals(reportType)){
			return new ModelAndView("system/log/userBroswerPie");
		}else if("line".equals(reportType)) {
			return new ModelAndView("system/log/userBroswerLine");
		}
		return new ModelAndView("system/log/userBroswer");
	}
}
